import { http } from "./http";

/** GPT列表 */
export function getGptList() {
    return http.get("/ailist");
}
/** 获取公有额度 */
export function getPublicLimit() {
    return http.get("/publicLimit");
}
/** 获取私有额度 */
export function getQuota() {
    return http.get("/quota");
}
/** 对话列表->加载 */
export function getChatList() {
    return http.get("/selectDialogueList");
}
/** 对话列表->删除 */
export function delChatList(titleId: number) {
    return http({
        method: 'post',
        url: '/deleteTitle',
        params: {
            titleId
        }
    });
}
/** 对话列表->新建 */
export function creChatList(name: string) {
    return http({
        method: 'post',
        url: '/addDialogueList',
        params: {
            name
        }
    });
}
/** 获取对话记录 */
export function getChatRecord(titleId: number, page: number, size: number) {
    return http({
        method: 'post',
        url: '/selectSessionRecord',
        headers: {
            dlog: true
        },
        params: {
            titleId,
            currentPage: page,
            rows: size
        }
    });
}
/** AI对话 */
export function chat(titleId: number, cent: string, aiId: number) {
    return http({
        method: 'post',
        url: '/DialogueAI',
        params: {
            titleId,
            cent,
            aiId
        }
    });
}
/** 清空对话记录 */
export function clearChatRecord(titleId: number) {
    return http({
        method: 'post',
        url: '/deleteChat',
        params: {
            titleId
        }
    });
}